package cn.xscrum.vtsp.service.impl;

import java.util.List;
import cn.xscrum.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.xscrum.vtsp.mapper.VtspAdviserMapper;
import cn.xscrum.vtsp.domain.VtspAdviser;
import cn.xscrum.vtsp.service.IVtspAdviserService;
import cn.xscrum.common.core.text.Convert;

/**
 * 志愿者顾问信息Service业务层处理
 * 
 * @author xscrum
 * @date 2021-10-01
 */
@Service
public class VtspAdviserServiceImpl implements IVtspAdviserService 
{
    @Autowired
    private VtspAdviserMapper vtspAdviserMapper;

    /**
	 * 查询志愿者顾问信息
     * 
     * @param adviserId 志愿者顾问信息ID
     * @return 志愿者顾问信息
     */
    @Override
    public VtspAdviser selectVtspAdviserById(Long adviserId)
    {
        return vtspAdviserMapper.selectVtspAdviserById(adviserId);
    }

    /**
	 * 查询志愿者顾问信息列表
     * 
     * @param vtspAdviser 志愿者顾问信息
     * @return 志愿者顾问信息
     */
    @Override
    public List<VtspAdviser> selectVtspAdviserList(VtspAdviser vtspAdviser)
    {
        return vtspAdviserMapper.selectVtspAdviserList(vtspAdviser);
    }

    /**
	 * 新增志愿者顾问信息
     * 
     * @param vtspAdviser 志愿者顾问信息
     * @return 结果
     */
    @Override
    public int insertVtspAdviser(VtspAdviser vtspAdviser)
    {
        vtspAdviser.setCreateTime(DateUtils.getNowDate());
        return vtspAdviserMapper.insertVtspAdviser(vtspAdviser);
    }

    /**
	 * 修改志愿者顾问信息
     * 
     * @param vtspAdviser 志愿者顾问信息
     * @return 结果
     */
    @Override
    public int updateVtspAdviser(VtspAdviser vtspAdviser)
    {
        vtspAdviser.setUpdateTime(DateUtils.getNowDate());
        return vtspAdviserMapper.updateVtspAdviser(vtspAdviser);
    }

    /**
	 * 删除志愿者顾问信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteVtspAdviserByIds(String ids)
    {
        return vtspAdviserMapper.deleteVtspAdviserByIds(Convert.toStrArray(ids));
    }

    /**
	 * 删除志愿者顾问信息信息
     * 
     * @param adviserId 志愿者顾问信息ID
     * @return 结果
     */
    @Override
    public int deleteVtspAdviserById(Long adviserId)
    {
        return vtspAdviserMapper.deleteVtspAdviserById(adviserId);
    }
}
